package com.tzxx.spider.spiderbots.base;

import com.tzxx.spider.core.TypeEnum;
import com.tzxx.spider.core.exception.SpiderNotFoundException;
import com.tzxx.spider.domain.Template;
import com.tzxx.spider.spiderbots.ListSpider;

/**
 * 文章列表url爬虫工厂类
 * @author tzxx
 */

public class ParseListFactory {

    private ParseListFactory() {}

    public static BaseUrlListSpider getSpider(Template template) {
        if (TypeEnum.List_ORDERING.getValue() == template.getType()) {
            return new ListSpider(template);
        } else if (TypeEnum.Detail_ORDERING.getValue() == template.getType()) {

        }
        throw new SpiderNotFoundException();
    }
}
